import { ResPage } from "@/api/interface/index";
import http from "@/api";
import { Business } from "@/api/interface/businessConfig";

/**
 * @name 业务配置模块
 */
// 业务-列表
export const getBusinessList = params => {
  return http.get<ResPage<Business.ResConfigList>>(`/ticket/api/business/`, params);
};
// 业务-详情
export const getBusinessDetail = id => {
  return http.get<Business.ResConfigList>(`/ticket/api/business/${id}/`);
};
// 业务-模块
export const getBusinessModule = () => {
  return http.get<any>(`/ticket/api/business/modules/`);
};
// 业务-新建
export const createBusiness = params => {
  return http.post(`/ticket/api/business/`, params);
};
// 业务-更新
export const modifyBusiness = (id, params) => {
  return http.patch(`/ticket/api/business/${id}/`, params);
};
// 业务-删除
export const deleteBusiness = (id, params?) => {
  return http.delete(`/ticket/api/business/${id}/`, params);
};
